A table with sorting and filtering support. Furthermore the table has some built in features to render icons, dates, comboboxes, Change color of foreground and background of the table cells etc.
Anchor | 1x2 Integer: default value: [] | The index (row and column) of the first selected cell in the current selection. Some interfaces display the anchor in a special way. e.g. Windows95 displays the lead index with a dotted yellow outline. |
BackgroundColor | The background color of the table. | 1-by-3 matrix of RGB values, default value is system dependent |
BMenu | Handle, default value: [] | The handle of the menu associated with the table's columncontrol button in the right upper corner of the table. The context menu is displayed whenever you click on the columncontrol button. Menuitems are added after the standard menu of the table. |
Border | Boolean, default value: true | Indicates if a border is shown around the table's scrollpane. |
Busy | Boolean, default value: False | If true a indeterminate progress indicator appears on the faded table. While this indicator is visible the table is disabled. |
BusyAction | cancel | {queue} | Callback queuing. Determines how MATLAB handles the execution of interrupting callbacks. A running callback is the currently executing callback. The interrupting callback is the callback that tries to interrupt the running callback. The BusyAction property of the interrupting callback determines how MATLAB handles its execution. When the BusyAction property is set to: 'queue' ? Puts the interrupting callback in a queue to be processed after the running callback finishes execution. 'cancel' ? Discards the interrupting callback as MATLAB finishes execution. For information about how the Interruptible property of the callback controls whether other callbacks can interrupt the running callback, see the Interruptible property description. |
Callback | String, cell array or function handle, default value: [] | Function that executes when the user changes the current selection. Selection can be changed by clicking with the left mousebutton or by using up/down/left/right, enter, tab, pageUp/PageDown, Ctrl+a or home/end keys The number of clicks can be determined from the callback event by using get(event, 'clickcount') |
CellBackgroundColor | Matrix, default value: [] | Specifies an index in the ColorSet for every table cell. This matrix with indices has the same size (rows and columns) as the data in the table. The colorindex is used to look up the color in the table's ColorSet and sets every cell's background color. e.g. ColorSet = [0 0 0 1; 0 --> blue 1 1 0 0] 1 --> red and Colorindex = [1 1 1;0 0 0] makes the first row red and the second row blue NOTE: Do not forget to specify the table's ColorSet |
CellForegroundColor | Matrix, default value: [] | Specifies an index in the ColorSet for every table cell. This matrix with indices has the same size (rows and columns) as the data in the table. The colorindex is used to look up the color in the table's ColorSet and sets every cell's foreground (text) color if possible. e.g. ColorSet = [0 0 0 1; 0 --> blue 1 1 0 0] 1 --> red and Colorindex = [1 1 1;0 0 0] makes the text of the first row red and the second row blue NOTE: Do not forget to specify the table's ColorSet. |
CellSelection | Boolean: default value: False | Indicates whether the user can select single cells (true) or only rows (false) in the table. |
CellTooltips | Cellstring, default value: {} (no tooltips) | Set the tooltips for the table cells. |
Children | The component's children. | |
Clipping | clipping | Clipping mode. This property has no direct effect on the objects Use this property if you want to implement your own custom |
CMenu | Handle, default value: [] | The handle of the context menu associated with the table. The context menu is displayed whenever you right-click over the table. Use the Matlab uicontextmenu function to create the context menu. |
ColorSet | Matrix Nx4, default value: [] (no colors) | First column is a key Second, third and fourth column specify the RGB values for the corresponding index. The colorset is used to determine the color of every cell in the table by using the color key specified for every cell. The colorset is also used to determine the colors for piecebars (see ColumnFormats). |
ColumnClass (Read-only) | CellString with class per column. | |
ColumnControl | Boolean, default value: False | The Column Control is an icon that renders to the right of the column headers, just above the vertical scrollbar. When a user clicks the icon, a popup menu appears. This popupmenu can be defined by using the table's property ControlButtonMenu. Do not forget to set the property 'ColumnControl' to true, to make the ColumnControl button visible. |
ColumnEditable | Logical index in table columns, default value: [] (not editable) | Specifies the columns which are editable. Example: [true false true false] makes the first and third column of the table editable. See the property datacallback for information about how to deal with cell edits. EXAMPLE: h = jacontrol(figure,'style','table',... 'units','normalized',... 'position',[0 0 1 1],... 'data',num2cell([(1:6)',rand(6)]),... 'ColumnEditable',[false true]) This will result in the second column being editable. Double click on a cell to edit its contents. Note that changing the value of a cell does not automatically invoke the tablesort. Many tables have an active callback. in this case, the default behavior is that a double click results in calling table.callback twice, followed by entering edit mode. To avoid executing table.callback all the way, use utility "getClickedColumn": set(h,'callback',@exampleCallback) Set table.editcallback to process the value that is entered in edit mode: set(h,'editcallback',@exampleCallback) |
ColumnFormats | Cellstring, default value: {}. | Set the format of the table's columns. Possible values: icon render string as icon, the icon is looked up in the iconset legend render hg handles as legend items filesize render numbers as a filesize, e.g. 1024 renders as 1 KB date use matlab datestr formatting to render a Matlab datenum as a date. e.g. 'dd mmm yyyy' renders a datenum as 01 mrt 2016 bar render numbers as a bar absbar render absolute numbers as a bar, the bars are colored red in case of negative numbers piecebar render intervals of numbers as colored bars color render an rgb color triple e.g. [0 1 0] as a color EXAMPLE h = jacontrol(figure,'style','table',... 'units','normalized',... 'position',[0 0 1 1],... 'data',{'color1' rand(1,3);'color2' rand(1,3);'color3' rand(1,3)},... 'columnformats',{'string','color'},... 'ColumnEditable',[false true]) data=; jacontrol(figure,'style',table' number use sprintf format for numbers e.g. %g or %6.4f string render value as a string NOTE: use '' for boolean, integers |
ColumnNames | Cellstring, default value: {}. | Set the names (headers) of the table columns. |
ColumnOrder | Array, default value: [1:end]. | Set the order and visibility of the columns |
ColumnTooltips | Cellstring, default value: {} (no tooltips) | Set the tooltips for the table columns. |
ColumnWidths | Array, default value: []. | Set the widths of the table's columns, -1 if auto. |
ContextMenu | Handle, default value: [] | The handle of the context menu associated with the table. The context menu is displayed whenever you right-click over the table. Use the Matlab uicontextmenu function to create the context menu. |
ControlButtonMenu | Handle, default value: [] | The handle of the menu associated with the table's columncontrol button in the right upper corner of the table. The context menu is displayed whenever you click on the columncontrol button. Menuitems are added after the standard menu of the table. |
Data | [MxN] Cell array, default value []: | Data for table, every column should have the same format e.g. all strings or numbers. Data is an [MxN] cell array containing the table data, with M the number of rows and N the number of columns. Requirement: All cells in a column must have the same format e.g. all strings, numbers, logicals, etc. EXAMPLE h = jacontrol(figure,... 'style','table',... 'position',[20 20 500,370],... 'data',num2cell(rand(100,5))); |
DataCallback | String, cell array or function handle, default value: [] | Function that executes when the user changes the value of a cell in the table. |
DateFormat | OBSOLETE | |
DragEnabled | Boolean, default value: false | Specifies if the content of the selected cells/rows/columns can be dragged into another component or application. |
Editable | DEPRECATED, replaced by 'ColumnEditable' | Specifies the columns which are editable. Logical index in table columns, default value: [] (not editable) |
EditCallback | String, cell array or function handle, default value: [] | Function that executes when the user changes the value of a cell in the table. Use getTableValue to obtain information about which cell(s) of the table are edited |
Enable | {on} | inactive | off | Disable or enable the component. This property controls how components respond to user interaction. Possible values for this property: on ? The component is operational (the default). inactive ? The component is not operational, but looks the same as when Enable is on. off ? The component is not operational and is grayed out. |
Extent | Width and height are the dimensions of the rectangle. All measurements are in units specified by the Units property. | Position rectangle (read only). A four-element vector that defines the size and position of the component. It has the form: [xpos,ypos,width,height] The first two elements are always zero are the component's position on the x- and y-axis. w |
FilteredRows | Vector of integers or vector of boolean, default value: [] | Specifies the visible rows. If a vector of booleans is used its length must be equal to the number of rows in the table. |
FilterVisible | Boolean, default value: false | Show data dependent filter in the columns of the table |
FontAngle | {normal} | italic | Setting this property to italic selects a slanted version of the component's font, when it is available on your system. |
FontName | String, default is system dependent. | The name of the font in which to display the text in the components. To display and print properly, this must be a font that your system supports. Use listfonts to list all available system fontnames. |
FontSize | Integer, default value is system dependent. | A number specifying the size in pixels of the component's font. |
FontUnits | {points} | normalized | inches | centimeters | pixels | This property determines the units used by the FontSize property. Normalized units interpret FontSize as a fraction of the height of the uicontrol. When you resize the uicontrol, MATLAB modifies the screen FontSize accordingly. pixels, inches, centimeters, and points are absolute units (1 point = 1/72 inch). |
FontWeight | {normal} | bold | Setting this property to bold selects a bold version of the component's font, when it is available on your system. |
ForegroundColor | RGB triple, default value is system dependent | The foreground color of the table (font color). |
Grid | {grid} | horizontal | vertical | none | Specifies whether the table draws horizontal lines, vertical lines, both or nothing between the table cells. |
GridBackground | The background color of the table. | 1-by-3 matrix of RGB values, default value is system dependent |
GridColor | RGB triple, default value is system dependent | The color of the table's (partial) grid when visible. |
HeaderBackgroundColor | RGB triple, default value is system dependent | The background color of the table header. |
HeaderFontAngle | {normal} | italic | Setting this property to italic selects a slanted version of the table header's font. |
HeaderFontName | String, default is system dependent. | The name of the font in which to display the string in the table header. To display and print properly, this must be a font that your system supports. Use listfonts to list all available system fontnames. |
HeaderFontSize | Integer, default value is system dependent. | A number specifying the size in pixels of the table header's font. |
HeaderFontWeight | {normal} | bold | Setting this property to bold selects a bold version of the table header's font. |
HeaderForegroundColor | RGB triple, default value is system dependent | The foreground color of the table (text color) . |
HeaderVisible | Boolean, default value: True | Display a header with columnnames above the table. |
Highlighter | An RGB triple | {none} | genericgrey | beige | classicLinePrinter | floralWhite | linePrinter | quickSilver | ledger | matlab | notepad | Rows can be highlighted to make it easier to distinguish between different rows by using a subtle background color scheme for every other row. |
Iconset | String, default value: '' | The name of the jar file with icons or the full path to the jar file. |
InfoLabel | Boolean, default value: False | Specifies if a label with info is visible in the lower right corner of the table. This label shows information about the number of selected rows, the number of visible rows (after filtering) and the total number of available rows. |
InfoLabelFontAngle | {normal} | italic | Setting this property to italic selects a slanted version of the info label's font, when it is available on your system. |
InfoLabelFontName | String, default is system dependent. | The name of the font in which to display the string in the info label. To display and print properly, this must be a font that your system supports. Use listfonts to list all available system fontnames. |
InfoLabelFontSize | Integer, default value is system dependent. | A number specifying the size in pixels of the info label's font. |
InfoLabelFontWeight | {normal} | bold | Setting this property to bold selects a bold version of the infor label's font, when it is available on your system. |
Interruptible | off | {on} | Callback routine interruption. Controls whether MATLAB can interrupt an object's callback function when subsequent callbacks attempt to interrupt it. |
JavaHandle | Java object | The underlying java object. See javacomponent |
KeyPressedCallback | String, cell array or function handle, default value: [] | Function that executes when the user presses a key or combination of keys. EXAMPLE h = jacontrol(figure,'style','table',... 'units','normalized',... 'position',[0 0 1 1],... 'data',num2cell([(1:6)',rand(6)]),... 'KeyPressedCallback',@exampleCallback) ZIJPP 20160302: example does not work |
MatlabHandle | Matlab handle | The handle of the associated Matlab container for this java object. See javacomponent |
MaximumSize | Array, [width height] | The component's maximum size, measured in pixels. The preferred size indicates the best size for the component. The component should be no larger than its maximum size and no smaller than its minimum size. NOTE: Matlab may overrule this setting if the component is not in a Panel, ScrollPane, Toolbar, SplitPane or TabbedPane. |
MinimumSize | Array, [width height] | The component's minimum size, measured in pixels. The preferred size indicates the best size for the component. The component should be no larger than its maximum size and no smaller than its minimum size. NOTE: Matlab may overrule this setting if the component is not in a Panel, ScrollPane, Toolbar, SplitPane or TabbedPane.rtain layout managers. |
MouseClickedCallback | String, cell array or function handle, default value: [] | Specifies the function that should be executed when the mouse is clicked on the component |
MouseEnteredCallback | String, cell array or function handle, default value: [] | Specifies the callback function that should be executed when the mouse enters the component. |
MouseExitedCallback | String, cell array or function handle, default value: [] | Specifies the callback function that should be executed when the mouse exits the component. |
NextFocusableComponent | Jacontrol, default value: [] | Specifies the next component to get the focus after this one. for example, when the tab key or shift-tab key is used. |
NumberFormat | String, default value: '%g ' | Specifies the numberformat for all the numeric columns in the table Format can be a sprintf format, see doc sprintf For example %g or %6.2f Note that if the property 'ColumnFormat' is not empty for a column, the 'ColumnFormat' overrules the numberformat Warning: it is not possible to use integer formatting for doubles. |
Order (Read-only) | otherwise index in original data | Order of elements in current table Array of int, default value: [1:nrows] 0 -> not visible |
Parent | The component's parent. | |
PasteEnabled | Boolean, default value: true | Allow pasting of cells (from Excel) into table |
Position | Array, [width height] | Size and location of the component. The rectangle defined by this property specifies the size and location of the component within the parent. Specify Position as [left bottom width height] left and bottom are the distance from the lower-left corner of the parent object to the lower-left corner of the component. width and height are the dimensions of the component. All measurements are in units specified by the Units property. |
PreferredSize | Array, [width height] | The component's preferred size, measured in pixels. The preferred size indicates the best size for the component. The component should be no larger than its maximum size and no smaller than its minimum size. NOTE: Matlab may overrule this setting if the component is not in a Panel, ScrollPane, Toolbar, SplitPane or TabbedPane. |
Prompt | String, default value: '' | The prompt text (shown if table is empty) EXAMPLE: h=jacontrol(figure,'style','table',... 'position',[20 20 500,370],... 'Prompt','<html>No <b>data</b> available'); |
RowFilter | Vector of integers or vector of boolean, default value: [] | Specifies the visible rows. If a vector of booleans is used its length must be equal to the number of rows in the table. |
RowHeight | Integer: default value is system dependent | The height in pixels of each row in the table. |
Rows | Integer: default value: [] | A a vector of indices corresponding to the currently selected table rows. 1 corresponds to the first row in the table. Note that the index refers to the raw data and not to the current view of the table |
Scrollbar | Boolean, default value: False | Normally a Table in a scrollPane will fit all columns within the scrollpane's viewport, possibly causing some of them to resize beneath an optimal width and making them illegible. By setting the Scrollbar property to true all columns will be resized to their preferred width, possibly extending the table outside the scrollpane's viewport. |
SelectedColumns | Integer: default value: [] | A vector of indices corresponding to the currently selected table columns. 1 corresponds to the first column in the table. Note that the index refers to the raw data and not to the current view of the table |
SelectedRows | Integer: default value: [] | A a vector of indices corresponding to the currently selected table rows. 1 corresponds to the first row in the table. Note that the index refers to the raw data and not to the current view of the table |
SelectionCallback | String, cell array or function handle, default value: [] | Function that executes when the user changes the current selection. Selection can be changed by clicking with the left mousebutton or by using up/down/left/right, enter, tab, pageUp/PageDown, Ctrl+a or home/end keys The number of clicks can be determined from the callback event by using get(event, 'clickcount') |
SelectionMode | {1} | 2 | 3 | 5 | 6 | 7 | 11 | The selection mode. The following selectionMode values are allowed: 1: SINGLE_SELECTION Only one list index can be selected at a time. 2: SINGLE_INTERVAL_SELECTION One contiguous index interval can be selected at a time. 3: MULTIPLE_INTERVAL_SELECTION In this mode, there's no restriction on what can be selected. 5: SINGLE_SELECTION_TOGGLE Only one list index can be selected at a time. Mouse toggles selection. 6: SINGLE_INTERVAL_SELECTION_TOGGLE One contiguous index interval can be selected at a time. Mouse toggles selection. 7: MULTIPLE_INTERVAL_SELECTION_TOGGLE In this mode, there's no restriction on what can be selected. Mouse toggles selection. 11: SINGLE_SELECTION_INTERVAL Only one list index can be selected at a time. All rows in the table above the selected row are painted (not selected) with the selection color |
Sortable | Boolean, default value: true | Indicates whether the table is sorttable |
Sortorder | Array, default value: [] (No sorting) | Specifies the sortorder per column: [columnnumber1 sortorder ... columnnumbern sortorder] 1 --> Sort ascending 0 --> Unsorted -1 --> Sort descending For example [1 1 3 -1] to sort the first column ascending and subsequently the third column descending |
Style | Table (Read only) | |
TableFilterHeader | Boolean, default value: false | Specifies if the tableheader for filtering is visible |
Tag | String, default value: '' | User specified object identifier. Use this tag i.c.w. gcjh('tag',parent) to find a modelit.ui.Jacontrol |
TooltipString | String, default value: '' | The TooltipString property specifies the text of the tooltip associated with the table. When the user moves the mouse pointer over the table and leaves it there, the tooltip is displayed. HTML can be used to format the tooltipstring?s text. |
Type | Read only property fixed to 'Jacontrol' | String with the object type. |
Units | {pixels} | normalized | inches | centimeters | points | characters | Used to interpret the extent and position properties. All units are measured from the lower-left corner of the parent object. Normalized units map the lower-left corner of the parent object to (0,0) and the upper-right corner to (1.0,1.0). pixels, inches, centimeters, and points are absolute units (1 point = 1/72 inch). Character units are characters using the default system font; the width of one character is the width of the letter x, the height of one character is the distance between the baselines of two lines of text. If you change the value of Units, it is good practice to return it to its default value after completing your computation so as not to affect other functions that assume Units is set to the default value. |
Userdata | Array, default value: [] | User specified data for this modelit.ui.Jacontrol object |
Value | Integer: default value: [] | A a vector of indices corresponding to the currently selected table rows. 1 corresponds to the first row in the table. Note that the index refers to the raw data and not to the current view of the table |
Visible | Off | {On} | Component visibility. By default, all jacontrols are visible. When set to off, the jacontrol is not visible, but still exists and you can query and set its properties. |
Reset object fields to empty values, called by the destructor.
cleanup(obj)
obj | any | modelit.ui.Jacontrol |
No output
modelit.ui.Table constructor.
obj = modelit.ui.Table(parent, varargin)
parent | any | handle of the Table's parent e.g. gcf or modelit.ui.Panel |
varargin | any | parameter-value pairs, see Table properties for a description of the parameters and their values Documentation for modelit.ui.Table/Table doc modelit.ui.Table |
Programmatically select a row in the table. With this routine the first, last, previous or next row can be selected in the current table (with its current sorting and filtering status).
tableAction(sorttable, actionKey)
obj | any | modelit.ui.Table |
actionKey | any | string with action, allowed values: - 'selectPreviousRow' - 'selectNextRow' - 'selectFirstRow' - 'selectLastRow' - 'find' - 'copy' - 'selectAll' |
No direct output
Programmatically set a value in the table.
setValueAt(obj, row, col, value)
obj | any | modelit.ui.Table |
row | any | integer with the row in the data model which has to be changed. |
col | any | integer with the column in the data model which has to be changed. |
value | any | the new value. |
No direct output the value in cell (row, col) of the data model is adjusted.
Get a value in the table.
value = getValueAt(obj, row, col)
obj | any | modelit.ui.Table |
row | any | integer with the row in the data model which has to be changed. |
col | any | integer with the column in the data model which has to be changed. |
value | any | the new value. |
modelit.ui.Jacontrol destructor.
delete(obj)
obj | any | modelit.ui.Jacontrol |
No output Help for modelit.ui.Table/delete is inherited from superclass MODELIT.UI.JACONTROL
True if application defined data exists.
value = isappdata(obj, name)
obj | any | a modelit.ui.Jacontrol object |
name | any | string with the name of the application data |
value | any | True if the application defined data exists Help for modelit.ui.Table/isappdata is inherited from superclass MODELIT.UI.JACONTROL |
Get application defined data.
value = getappdata(obj, name)
obj | any | a modelit.ui.Jacontrol object |
name | any | string with the name of the application data |
value | any | The application defined data Help for modelit.ui.Table/getappdata is inherited from superclass MODELIT.UI.JACONTROL |
Set application defined data.
setappdata(obj, name, value)
obj | any | a modelit.ui.Jacontrol object |
name | any | string with the name of the application data |
value | any | value to be stored. May be anything |
No output. The application-defined data, which is created if it does not already exist, is assigned a name and a value. Help for modelit.ui.Table/setappdata is inherited from superclass MODELIT.UI.JACONTROL
Returns true if this is a valid graphics object
value = ishandle(obj)
obj | any | a modelit.ui.Jacontrol object |
value | any | boolean: true if this is a valid graphics object What does "valid" mean in this context?? Matlab HG object/container that holds still exist? Help for modelit.ui.Table/ishandle is inherited from superclass MODELIT.UI.JACONTROL |
Returns the underlying Java object
jobj = java(obj)
obj | any | a modelit.ui.Jacontrol object |
jobj | any | java object Help for modelit.ui.Table/java is inherited from superclass MODELIT.UI.JACONTROL |
Returns the handle of the component's Matlab container
h = handle(obj)
obj | any | a modelit.ui.Jacontrol object |
h | any | handle of the component's Matlab container Help for modelit.ui.Table/handle is inherited from superclass MODELIT.UI.JACONTROL |
Returns the handle of the closest ancestor of obj that matches one of the types in type,
p = ancestor(obj, type)
obj | any | modelit.ui.Jacontrol |
type | any | String or cell array of strings (types) |
p | any | handle of the closest ancestor of the obj that matches one of the types in type Help for modelit.ui.Table/ancestor is inherited from superclass MODELIT.UI.JACONTROL |
Create a default object for heterogeneous arrays. Help for modelit.ui.Table.getDefaultScalarElement is inherited from superclass MODELIT.UI.ABSTRACTJACONTROL
Not equal relation for handles. Help for modelit.ui.Table/ne is inherited from superclass MODELIT.UI.ABSTRACTJACONTROL
Equal relation for handles. Help for modelit.ui.Table/eq is inherited from superclass MODELIT.UI.ABSTRACTJACONTROL
Returns the objects whose property values match those passed as param-value pairs to the findobj command. Help for modelit.ui.Table/findobj is inherited from superclass MODELIT.UI.ABSTRACTJACONTROL
Set object properties Help for modelit.ui.Table/set is inherited from superclass MODELIT.UI.ABSTRACTJACONTROL